From 69bc42f44441bd0f71a496faa5379a588ad52aac Mon Sep 17 00:00:00 2001 From: =?utf8?q?Timm=20B=C3=A4der?= Date: Sun, 13 Jan 2019 07:23:10 +0100 Subject: [PATCH] =?utf8?q?rendernodepaintable:=20Don't=20try=20to=20snapsh?= =?utf8?q?ot=200=C3=970=20nodes?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Considering the operations that some of the rendernode constructors do, nodes with width or height 0 (or both of course) are very well possible. This would break in the rendernodepaintable when adding a transform, which divides by width/height of the rendernode. --- gtk/gtkrendernodepaintable.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gtk/gtkrendernodepaintable.c b/gtk/gtkrendernodepaintable.c index 7ee40b138b..8e67150a37 100644 --- a/gtk/gtkrendernodepaintable.c +++ b/gtk/gtkrendernodepaintable.c @@ -45,6 +45,10 @@ gtk_render_node_paintable_paintable_snapshot (GdkPaintable *paintable, GtkRenderNodePaintable *self = GTK_RENDER_NODE_PAINTABLE (paintable); gboolean needs_transform; + if (self->bounds.size.width <= 0 || + self->bounds.size.height <= 0) + return; + needs_transform = self->bounds.size.width != width || self->bounds.size.height != height; -- 2.30.2